added controller method to get application by id