Take out if else statement to test that is why we are getting internal server error