Added json API route for recent posts
create and search routes at the top to intercept requests
Route configration commented and routes seperated by their fuinction
Added pagination for json response