History API moved to ajax success

Now the api works when the ajax call is successful and we can grab the
called page title