For the applications I’ve made, I generally start by making sure any data that is requested by the API is able to be requested by that user, and that they only see the bits they are allowed to. This is done (generally) in two ways.
The first is to identify each user for each request. This can be as simple as establishing a token for that user, and when a request is made, look for that token in your database, check it is associated to a user, and that it hasn’t expired. Its a good idea to rotate these tokens so it a ‘bad guy’ gets a hold of one, they can’t use it forever. If a user logs out it should definitely destroy it. Another common method is OAuth, or some other third party identity service.
To work out a token, you could generate a random string when a successful login occurs and store it. As I said earlier, make sure it is actually random. Depending on your server language of choice there’s likely to be a cryptographically secure pseudo random data generator available. For example, in PHP you could use openssl_random_pseudo_bytes(), rand() is not sufficiently unpredictable.
Once you can reliably determine what user is making the request, you should check that what they are asking for is in fact able to be seen by them. I generally have a permissions system which I can ask ‘does this user have access to see this thing’. A simpler example of this might be an API request that returns a user object, and simply checking that the logged in user is the same as the one being requested. There are so many ways of doing this, but the general idea remains the same.
If you have sensitive data, its not sufficient to just not display it in the UI, but still send it to the client. Its trivial to extract data (if you look at the AJAX requests in the browser developer tools for example) you are not supposed to see, so the idea here is not to send it at all. Make your UI react to the data it gets, which will make your application much more robust and less prone to leaking stuff it shouldn’t. One should always assume the browser is a hostile environment. In angular I have a $http interceptor that will deal with the event where 401/403 response is sent from the api and prompt the user to authenticate if necessary.
HTH